package com.googlecode.sere.util

import org.slf4j.LoggerFactory

trait Logging {
	val logger = LoggerFactory.getLogger(Logging.loggerNameForClass(getClass.getName))
}

object Logging {
 	def loggerNameForClass(className: String) = {
 		// Leaves out some information
		val ClassName = """((?:(?!\$\$).)+).*""".r
		className match {
			case ClassName(name) => name
			case _ => throw new IllegalArgumentException(className) 
		}
	}
}
